package Bug;

/**
 * @author: wh(1835734390 @ qq.com)
 * @date: 2024/6/19 11:36
 * @description:
 * @version:
 */
public class I18nExample {

    public static void main(String[] args) {
        System.out.println(toUnicode("常规的文件写入检查失败"));
    }
    public static String toUnicode(String text) {
        StringBuilder unicodeText = new StringBuilder();
        for (char character : text.toCharArray()) {
            unicodeText.append(String.format("\\u%04x", (int) character));
        }
        return unicodeText.toString();
    }
}